package com.day02;

/**
 * @author 上官
 * @date 2024/7/6 19:08
 */
public class Triple<L, M, R> {


    private L left;

    private M middle;

    private R right;

    public Triple(L left, M middle, R right) {
        this.left = left;
        this.middle = middle;
        this.right = right;
    }

    public static <L1, M1, R1> Triple<L1, M1, R1> of(L1 left, M1 middle, R1 right) {
        Triple<String, Integer, Double>  of = new Triple(left, middle, right);
        return new Triple(left, middle, right);
    }

    public L printL() {
        return this.left;
    }

    public M printM() {
        return this.middle;
    }

    public R printR() {
        return this.right;
    }

    public static void main(String[] args) {
        Triple<String, String, Double> of = Triple.of("1", "1233", 123.33);
        String left = of.printL();
        String middle = of.printM();
        Double right = of.printR();

        System.out.println(left + " - " + middle + " - " + right);


    }
}
